﻿@model IEnumerable<Developer.Entity.Books>
@{
    Layout = "~/Views/Shared/_UILayout.cshtml";
}

<style>
    h5 {
        margin-bottom: 10px;
    }

    .mui-collapse-content img {
        width: 50%;
        float: left;
    }

    .detail {
        width: 45%;
        float: left;
        margin-left: 5%;
    }
    
</style>
<link rel="stylesheet" type="text/css" href="~/Content/UI/css/myprofile.css" />
@if (Model.Count() == 0)
{
    <div class="mui-content" style="padding-bottom: 100px;">
        <h4 class="mdui-text-center" style="margin-top: 100px;">未找到任何结果</h4>
    </div>
}
else
{
    <ul class="mui-table-view mui-card">
        @{
            foreach (var item in Model)
            {
                var country = string.Empty;
                if (item.Author.Contains('】'))
                {
                    country = item.Author.Split('】')[0];

                }
                else if (item.Author.Contains("]"))
                {
                    country = item.Author.Split(']')[0].Split('[')[1];
                }
                else
                {
                    country = item.Author;
                }
                <li class="mui-table-view-cell mui-collapse">
                    <a class="mui-navigate-right" href="#">@(item.Author.Contains('】') == true ? country + "】" + item.Name : (item.Author.Contains(']') == true ? "【" + country + "】" + item.Name : item.Name)  )</a>
                    <div class="mui-collapse-content">
                        <a href="/book/detail?bookId=@item.Id">
                            <img src="@item.CoverImg" class="mdui-shadow-8">
                        </a>
                        <div class="detail">
                            <h5><strong>书名：</strong>@item.Name</h5>
                            <strong><strong>作者：</strong>@(item.Author.Contains('】') == true ? item.Author.Split('】')[1] : (item.Author.Contains(']') == true ? item.Author.Split(']')[1] : item.Author))</strong>

                            <h5><strong>定价：</strong>@item.OriginPrice￥</h5>
                            <h5><strong>预定价：</strong>@item.OrderPrice￥</h5>
                            <h5><strong>ISBN：</strong>@item.ISBN</h5>
                            <h5><strong>馆存：</strong>@item.BookGits.First().Remain</h5>
                        </div>
                    </div>
                </li>

            }
        }

    </ul>

            }

